@layout('layouts.setup')

@section('setup')

@include('plugins.flasher')

{{Form::open('console/auth/authenticate', 'POST', array('class'=>'form login-form','id'=>'loginForm','data-ajax'=>'false','style'=>'border:1px solid #E5E5E5;margin:0px auto;padding:19px 29px 29px;max-width:300px;box-shadow:0 1px 2px rgba(0, 0, 0, 0.05)'))}}
    <legend>{{ Str::upper(__('global.login')) }}</legend>
    <label>Sila isi maklumat log masuk anda seperti di bawah.</label>
    <div class="body">
        <label>E-mel :</label>
        {{ Form::span12_text('su_username',null,array('placeholder'=>'E-mel','required')) }}
        <label>Kata Laluan :</label>
        {{ Form::span12_password('su_password',array('placeholder'=>'Kata Laluan','required')) }}
    </div>

    <div class="footer">
        <label class="checkbox inline">
            <strong>{{ HTML::link('forgotpassword', 'Lupa Kata Laluan')}}</strong>
        </label>
        {{ Form::submit('Log Masuk', array('class' => 'btn btn-info pull-right'))}}
        {{ Form::token()}}
    </div>

{{ Form::close()}}

</center>
@endsection
@section('scripts')

<script type="text/javascript">

var elements = document.getElementsByTagName('INPUT');  
for (var i = 0; i < elements.length; i++) {  
	elements[i].oninvalid = function(e) {  
		if (!e.target.validity.valid) {  
			if (e.target.name == "su_username") {
				e.target.setCustomValidity('Ruangan ini perlu diisi');  
			} else {
				e.target.setCustomValidity("Ruangan ini perlu diisi");
			}
		}  
	};  
	elements[i].oninput = function(e) {  
		//Must clear custom validity or field will always be considered invalid  
		e.target.setCustomValidity('');  
	};  
}  

</script>

@endsection
